package com.qd.panda.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 卷信息
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("panda_card_info")
public class CardInfo extends Model<CardInfo> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "card_msg_id", type = IdType.ASSIGN_ID)
    private String cardMsgId;
    /**
     * 兑换的开始时间
     */
    @TableField("use_start_time")
    private LocalDate useStartTime;
    /**
     * 兑换的结束时间
     */
    @TableField("use_end_time")
    private LocalDate useEndTime;
    /**
     * 卷有效期
     */
    @TableField("volume_validity")
    private Integer volumeValidity;
    /**
     * 使用规则
     */
    @TableField("use_rule")
    private String useRule;
    /**
     * 标题
     */
    @TableField("title")
    private String title;
    /**
     * 说明
     */
    @TableField("note")
    private String note;
    /**
     * 卷金额
     */
    @TableField("volume_amount")
    private BigDecimal volumeAmount;
    /**
     * 折扣
     */
    @TableField("discount")
    private Double discount;
    /**
     * 优惠金额
     */
    @TableField("discount_amount")
    private BigDecimal discountAmount;
    /**
     * 分配熊猫豆
     */
    @TableField("need_integral")
    private Integer needIntegral;
    /**
     * 卷数量
     */
    @TableField("card_quantity")
    private Integer cardQuantity;
    /**
     * 卷总数量
     */
    @TableField("total_card_quantity")
    private Integer totalCardQuantity;
    /**
     * 添加时间
     */
    @TableField("add_time")
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
    /**
     * 使用品牌
     */
    @TableField("use_brand")
    private String useBrand;
    /**
     * 计划ID
     */
    @TableField("plan_id")
    private String planId;
    /**
     * 机构ID
     */
    @TableField("org_id")
    private String orgId;
    /**
     * 操作人
     */
    @TableField("operator")
    private String operator;
    /**
     * 卷类型
     */
    @TableField("card_type")
    private String cardType;
    /**
     * 优惠方式
     */
    @TableField("discount_method")
    private String discountMethod;

    public void freeData() {
        this.cardMsgId = null;
        this.useStartTime = null;
        this.useEndTime = null;
        this.volumeValidity = null;
        this.useRule = null;
        this.title = null;
        this.note = null;
        this.volumeAmount = null;
        this.discount = null;
        this.discountAmount = null;
        this.needIntegral = null;
        this.cardQuantity = null;
        this.totalCardQuantity = null;
        this.addTime = null;
        this.updateTime = null;
        this.useBrand = null;
        this.planId = null;
        this.orgId = null;
        this.operator = null;
        this.cardType = null;
        this.discountMethod = null;
    }

}
